
<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8"/>
	<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
	<meta name="renderer" content="webkit">
	<title>奇虎文化管理后台</title>
	<link rel="stylesheet" type="text/css" href="/public/css/bootstrap/bootstrap.min.css"/>
	<link rel="stylesheet" type="text/css" href="/public/css/libs/font-awesome.css"/>
	<link rel="stylesheet" type="text/css" href="/public/css/libs/nanoscroller.css"/>
	<link rel="stylesheet" type="text/css" href="/public/css/common.css"/>
	<!-- <link href='//fonts.googleapis.com/css?family=Open+Sans:400,600,700,300|Titillium+Web:200,300,400' rel='stylesheet' type='text/css'> -->
	<link rel="stylesheet" type="text/css" href="/application/admin/static/css/style.css"/>
	<script src="/public/js/jquery.js"></script>
	<script type="text/javascript">
		var BASE_URL = ""; //根目录地址
	</script>
	<!--[if lt IE 9]>
	<script src="/public/js/html5shiv.js"></script>
	<script src="/public/js/respond.min.js"></script>
	<![endif]-->
</head>
<body>

<style>
	#sidebar-nav .nav>.open .submenu>li>.submenu a:before, #sidebar-nav .nav>.active .submenu>li>.submenu a:before {
		content: "";
	}
	body{font-size: 14px!important;}
</style>
<script type="text/javascript">

	//点击页面其他地方关闭
	document.onclick = function (e) {
		if(!$(e.target).is("#more") && $(".switch-mp").is(":visible")==true){
			$(".switch-mp").hide();
		}
		if ($(e.target).is("#more") && $(".switch-mp").is(":visible")===false)
		{

			$(".switch-mp").show();
		}
	}

</script>
<div id="theme-wrapper">

{block name="body"}
<div class="main-box clearfix">
	<header class="main-box-header clearfix">
		<div class="pull-left">
			<h2>{$meta_title}</h2>
		</div>
		<div class="pull-right">
			
		</div>
	</header>
	<div class="main-box-body clearfix">
		<form method="post" class="form form-horizontal">
			<table class="table table-striped">
				<thead>
					<tr>
						<th class="col-lg-2 text-right">分组</th>
						<th>权限</th>
					</tr>
				</thead>
				<tbody>
				{volist name="rolelist" id="node"}
				<tr>
					<td class="info col-lg-2 text-right">{$key}<input class="ids row-selected" type="checkbox" name="ids{$i}[]" data-group="{$key}" value=""></td>
					<td class="col-lg-10 text-left">
						{volist name="node" id="item"}
						<div class="checkbox-nice checkbox-inline">
							<input type="checkbox" name="rule[]"  class="rule"  data-group="{$item['group']}"  value="{$item['id']}" id="{$item['name']}" {if in_array($item['id'],$auth_list)}checked{/if} />
							<label for="{$item['name']}">{$item['title']}</label>
						</div>
						{/volist}
					</td>
				</tr>
				{/volist}
				</tbody>
			</table>
			<div class="form-group">
				<div class="col-lg-offset-2 col-lg-10">
					<input type="hidden" name="uid" value="{$uid}">
					<button type="submit" class="btn btn-success submit-btn ajax-post" target-form="form">确认提交</button>
					<!--<button class="btn btn-danger btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>-->
				</div>
			</div>
		</form>
	</div>
</div>
{/block}

{block name="script"}
<script>
	$(".ids").click(function(){
		var group = $(this).attr('data-group');
		if( $(this).is(':checked') ) {
			$(".rule[data-group="+group+"]").prop("checked",true);
		}else{
			$(".rule[data-group="+group+"]").prop("checked",false);
		}
	})

</script>
{/block}